<?php

class Registry implements ArrayAccess
{
    private $params = array();
    private static $_instance;
    
    private function __construct()
    {
        include_once 'config.php';
        $this->params = $params;
    }
    
    public static function getInstance ()
    {
          if (empty(self::$_instance))
          {
              self::$_instance = new Registry();
          }
          return self::$_instance;
    }
    
    public function offsetSet ($key, $value)
      {
          $this->params[$key] = $value;
      }
      
      public function offsetExists ($key)
      {
          return isset($this->$params[$key]);
      }
      
      public function offsetGet ($key)
      {
          return isset($this->params[$key]) ? $this->params[$key] : null;
      }
      
      public function offsetUnset ($key)
      {
          unset($this->params[$key]);
      }
}